package com.acwing.partition8;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/1/11 16:13
 */
public class AC797差分 {

    private static final int N = 100010;
    private static int[] nums = new int[N], diff = new int[N];
    private static int n = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] s = reader.readLine().split("\\s+");
        n = Integer.parseInt(s[0]);
        int k = Integer.parseInt(s[1]);
        s = reader.readLine().split("\\s+");
        for (int i = 1; i <= n; i++) {
            //前缀和 s[i] = s[i - 1] + a[i - 1] => 差分 a[i - 1] = s[i] - s[i - 1]
            nums[i] = Integer.parseInt(s[i - 1]);
            diff[i - 1] = nums[i] - nums[i - 1];
        }
        while (k-- > 0) {
            s = reader.readLine().split("\\s+");
            int left = Integer.parseInt(s[0]), right = Integer.parseInt(s[1]), c = Integer.parseInt(s[2]);
            //left、right从1开始，所以在差分数组中需要对left-1进行操作
            diff[left - 1] += c;
            diff[right] -= c;
        }
        //差分数组求前缀和就是结果数组
        for (int i = 1; i <= n; i++) nums[i] = nums[i - 1] + diff[i - 1];
        for (int i = 1; i <= n; i++) writer.write(nums[i] + " ");
        writer.flush();
    }
}
